<%@ page contentType="text/html; charset=UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
	String cssPath = basePath + "/app/survey/resource/design/css/";
	String scriptPath = basePath + "/app/survey/resource/design/script/";
	String imagePath = basePath + "/app/survey/resource/design/images/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>问卷设计</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta http-equiv="Content-Language" content="utf-8" />
	<meta http-equiv="Pragma" content="no-cache" />
	<meta http-equiv="expires" content="0" />
	
	<link href="<%=cssPath %>th-global.css" rel="stylesheet" type="text/css"/>
	<link href="<%=cssPath %>inner.css" rel="stylesheet" type="text/css" />
	<link href="<%=cssPath %>editor.css" rel="stylesheet" type="text/css" />
	<link href="<%=cssPath %>report.css" rel="stylesheet" type="text/css" />
	<link href="<%=scriptPath %>plugin/artDialog/css/default.css" rel="stylesheet" type="text/css" />
	<link href="<%=scriptPath %>plugin/jqueryui/css/jquery.ui.css" rel="stylesheet" type="text/css" />
	<link href="<%=scriptPath %>plugin/jqueryui/css/jquery-ui-timepicker-addon.css" rel="stylesheet" type="text/css" />
	<link href="<%=scriptPath %>plugin/lightbox/css/jquery.lightbox-0.5.css" rel="stylesheet" type="text/css" />
	<link href="<%=scriptPath %>plugin/jcrop/css/jquery.Jcrop.css" rel="stylesheet" type="text/css" />
	<link href="<%=scriptPath %>plugin/ueditor/css/ueditor.css" rel="stylesheet" type="text/css" />
	
	<script type="text/javascript">
		var ctx = '<%= basePath %>';
		var imagePath = '<%= imagePath %>'
	</script>
	<script type="text/javascript" src="<%=scriptPath %>common/jquery.min.js"></script>
	<script type="text/javascript" src="<%=scriptPath %>common/jquery.json-2.2.min.js"></script>
	<script type="text/javascript" src="<%=scriptPath %>common/jquery.selection.js"></script>
	<script type="text/javascript" src="<%=scriptPath %>common/msg.js"></script>
	<script type="text/javascript" src="<%=scriptPath %>common/swfobject.js"></script>
	
	<script type="text/javascript" src="<%=scriptPath %>plugin/jqueryui/script/jquery.ui.js"></script>
	<script type="text/javascript" src="<%=scriptPath %>plugin/jqueryui/script/jquery-ui-timepicker-addon.js"></script>
	<script type="text/javascript" src="<%=scriptPath %>plugin/jqueryui/script/jquery.ui.datepicker.js"></script>
	<script type="text/javascript" src="<%=scriptPath %>plugin/jqueryui/script/jquery.mtz.monthpicker.js"></script>
	<script type="text/javascript" src="<%=scriptPath %>plugin/uploadify/script/jquery.uploadify.v2.1.4.min.js"></script>
	
	<script type="text/javascript" src="<%=scriptPath %>plugin/artDialog/script/artDialog.min.js"></script>
	<script type="text/javascript" src="<%=scriptPath %>plugin/artDialog/script/artDialog.plugins.min.js"></script>
	<script type="text/javascript" src="<%=scriptPath %>plugin/jcrop/script/jquery.Jcrop.js"></script>
	<script type="text/javascript" src="<%=scriptPath %>plugin/lightbox/script/jquery.lightbox-0.5.js"></script>
	<script type="text/javascript" src="<%=scriptPath %>plugin/ueditor/script/editor_all.js"></script>
	<script type="text/javascript" src="<%=scriptPath %>plugin/ueditor/script/editor_config.js"></script>
	<script type="text/javascript" src="<%=scriptPath %>plugin/ueditor/script/codemirror.js"></script>
	<script type="text/javascript" src="<%=scriptPath %>plugin/ueditor/script/zh-cn.js"></script>
	
	<script type="text/javascript" src="<%=scriptPath %>survey/utils/tool.js"></script>
	<script type="text/javascript" src="<%=scriptPath %>survey/utils/common.js"></script>
	<script type="text/javascript" src="<%=scriptPath %>survey/constants/pagesize.js"></script>
	<script type="text/javascript" src="<%=scriptPath %>survey/constants/color.js"></script>
	<script type="text/javascript" src="<%=scriptPath %>survey/constants/questionlib.js"></script>
	<script type="text/javascript" src="<%=scriptPath %>survey/constants/questiontype.js"></script>
	<script type="text/javascript" src="<%=scriptPath %>survey/object/survey.js"></script>
	<script type="text/javascript" src="<%=scriptPath %>survey/object/page.js"></script>
	<script type="text/javascript" src="<%=scriptPath %>survey/object/question.js"></script>
	<script type="text/javascript" src="<%=scriptPath %>survey/object/answer.js"></script>

	<script type="text/javascript" src="<%=scriptPath %>survey/edit/question_edit.js"></script>
	<script type="text/javascript" src="<%=scriptPath %>survey/edit/question_edit_right_action.js"></script>
	<script type="text/javascript" src="<%=scriptPath %>survey/edit/question_edit_right_show.js"></script>
	<script type="text/javascript" src="<%=scriptPath %>survey/edit/question_edit_survey.js"></script>
	
	<script src="<%=scriptPath %>survey/edit/question_edit_survey.js" type="text/javascript"></script>
	<script src="<%=scriptPath %>survey/edit/question_edit_logo.js" type="text/javascript"></script>
	<script src="<%=scriptPath %>survey/edit/question_edit.js" type="text/javascript"></script>
	<script src="<%=scriptPath %>survey/edit/question_edit_right_action.js" type="text/javascript"></script>
	<script src="<%=scriptPath %>survey/edit/question_edit_right_show.js" type="text/javascript"></script>
	<script src="<%=scriptPath %>survey/edit/question_edit_left_show.js" type="text/javascript"></script>
	<script src="<%=scriptPath %>survey/edit/question_edit_left_action.js" type="text/javascript"></script>
	<script src="<%=scriptPath %>survey/edit/question_edit_left_action_normal.js" type="text/javascript"></script>
	<script src="<%=scriptPath %>survey/edit/question_edit_left_action_extra.js" type="text/javascript"></script>
	<script src="<%=scriptPath %>survey/edit/question_edit_left_action_upload.js" type="text/javascript"></script>
	<script src="<%=scriptPath %>survey/edit/question_edit_logic.js" type="text/javascript"></script>
	
	<script type="text/javascript">
		var roleCode = 'ts-public';
		var UEditor = null;
		var intro_UEditor = null;
		var description_UEditor = null;
		var defaulttheme = '1';
		var surveyThemeid = '1';
		var SURVEYID = '${surveyuuid}'; // 问卷主键
		var TemplateQuestionMap = {};
		var questionMap = {};
		var oldQuestionMap = {};
		var editQuestionMap = {};
		var survey = {};
		var lastpage = {id:''};
		var firstpage = {id:''}; // 首页
		var editFlag = false;
		var fieldtop = 0;
		var targetid = '';
		var answerCount = 0;
		var childQuestionCount = 0;
		var childAnswerCount = 11;
		var loadding = true; //加载标志
		//var jsessionid = '565CF570B2DE0C41A4925A5F1E79CA64-n1.jvm12_1';
		var DESCRIPTIONWORD = '请输入问卷描述内容';
		var ENDWORD = '请输入结束页自定义内容';
		var ENDWORD_URL = '输入页面URL';
		var DEFAULT_URL = 'http://www.diaoyanbao.com';
		//var surveyUrl = 'JvBK2sbi';
		var userPaste = '1';
		var userAge = '';
		var ent_edit_first = '';
		var surveyOut15='1';//超过15题提示用户
		var userAnswer10 = '1';//用户首次添加10个以上选项时触发"调研宝小技巧"，告知下拉菜单的呈现方式 ,每份问卷只提醒1次；用户勾选了"我知道了"，该账户不再提示该功能 
		var surveyAnswer10='';//用户首次添加10个以上选项时触发"调研宝小技巧"，告知下拉菜单的呈现方式 ,每份问卷只提醒1次；用户勾选了"我知道了"，该账户不再提示该功能 
		var themeGroups = [];
	
		var questionPrefix = 'Q';
		
		$(document).ready(function(){
			fieldtop = $('#addFields').offset().top; // 题型操作栏
			hideQuickOperate(); //调整操作提示位置
			showSurveyInfo(SURVEYID, setTimeout(function(){initSorttable();initDraggable();initDraggable2();},100));// 显示问卷内容
			getPageSize(); // 初始化页面参数
			
			// 滚动时,整体高度调整
			$(window).scroll(function () {
				var h = $('#stage').offset().top + $('#stage').height();//formPreview
				var formHeight = $('#stage').offset().top + $('#stage').height() + 20;
				if((($(document).scrollTop() + windowHeight) > h)){
					$('#main').removeClass('tooLong');
				}else{
					$('#main').addClass('tooLong');
				}
			});
			
			// 滚动时,操作栏位置调整
			$(window).scroll(function () {
				if($('#addFields').is(':visible')){
					showFieldsPosition();
			    }
				if($('#qeditshownone').is(':visible')){
					showNoFieldPosition();
			    }
			});
		});
		
		// 对问题进行排序;  初始化时的动作，应注意此时未有人员的操作加入
		function initSorttable(){
			$( "#sortable" ).sortable({
				cancel: '.notice', // 阻止排序动作在 “无问题”提示中发生
				revert: true, // 重新返回时加载动作
				receive: function(event, ui){ // 接收另一个对象时促发事件 启动等待接收用户丢进来的对象
					var index = -1; // 设置标志位
					var lis = $('#sortable').find('li'); // 查找所有的li
					for(var i =0 ; i< lis.length; i++){
						var obj = $(lis[i]); // 获取一个li
						if(obj.hasClass('ui-draggable')){ // 从中获取一个可拖动的对象，问题的容器
							index = i; // 获取标志位
						}
					}
					$('#sortable').find('li').eq(index).remove(); // 移除最后一个元素
					//var id = ui.item.context.id.substring(6);
					var id = ui.item.context.id.split('_')[1]; // ui.item 当前被拖动的对象 获取当前被拖动对象的类型ID
					if(!checkQuestionCount(id)){  // 控制问题数量？？？ 如果问题不存在时处理
						return;
					}
					var q = newQuestion(id); // 创建一个新的问题
					editFlag = true; //设置状态为编辑中
					var content = getRightShowHtml(q); // 根据问题生成内容
					if(index==0){
						if($('#sortable').find('li').length == 0){ // 无内容，增加新的问题
							$('#sortable').html(content);
						}else{
							$('#sortable').find('li').eq(0).before(content); // 在第一个加入
						}
					}else{
						$('#sortable').find('li').eq(index-1).after(content); // 最后一个加入
					}
					targetid = q.id; // 锁定编辑目标
					refreshNO(); // 更新题号
					if(q.showtype == 'page'){
						
					}else
						showLeftQuestion(targetid); // 开启左边问题编辑状态
					setTimeout(function(){refreshQuestionHeight(q.id);}, 100); // 刷新问题遮罩高度
					if(id == 'age'){ // 年龄类型进行校验
						checkFirstAge(q.id);
					}
					chkQestionCnt15(q.id); // 控制问题数量上限
				},
				update: function(event, ui){ // 排序动作结束，问题坐标已经发生改变	
					var qtype = ui.item.attr('id').split('_')[0]; // 问题类型
					if(qtype == 'qtype' || qtype == 'quickqtype'){
						editFlag = true;
						refreshNO();
						return;
					}
					var id = ui.item.attr('id').split('_')[1];
					var name = '';
					var p = questionMap[id];
					if(p.showtype == 'page'){ // 分页符号
						name = '分页符';
					}else{
						if(p.type > 0){
							name = $('#q_no_'+id).html() + '.' + ((getStringLength(p.description)>16*2)? getStringByByte(p.description, 15*2):p.description);
						}else{
							if(p.description == ''){
								name = '分节符';
							}else
								name = (getStringLength(p.description)>16*2)? getStringByByte(p.description, 15*2):p.description;
						}
						
					}
					checkLogic(id, // 移动造成逻辑问题的变动
						function(){
						artconfirm(formatMessage('edit_012', name), function(){ 
								sortQuestion();
							}, function(){
								$( "#sortable" ).sortable('cancel');
							}, '确定', '取消');
						}
						, function(){
							sortQuestion();
						});
				}
			});
		}
		
		function sortQuestion(){
			editFlag = true;
			refreshNO();
			showLeftQuestion(targetid);
		}
		function initDraggable(){
			$( "[id^=qtype_]" ).draggable({
				connectToSortable: "#sortable",
				//helper: "clone",
				helper: function(){
					return $('<li class="dragfld0" style="height: 50px;"></li>');
				},
				revert: "invalid",
				stop: function(event, ui){
				},
				start: function(event, ui) {
				},
				drag: function(event, ui) {
		
				}
			});
		}
		function initDraggable2(){
			$( "[id^=quickqtype_]" ).draggable({
				connectToSortable: "#sortable",
				//helper: "clone",
				helper: function(){
					return $('<li class="dragfld0" style="height: 50px;"></li>');
				},
				revert: "invalid",
				stop: function(event, ui){
				},
				start: function(event, ui) {
				},
				drag: function(event, ui) {
		
				}
			});
		}
	</script>
</head>
<body>
	<div id="container" class="">
		<!-- 标题栏开始  -->
		<div class="editer-nav">
			<h1 class="fl" id="topName" title="高血压调研">高血压调研</h1>
			<div class="fl">
				<a class="viewbtn" id="viewSurveyUrl" onclick="checkSurveyView('2c194a71-186f-4af9-8f07-217a0b72ac79', 'JvBK2sbi');return false;" href="javascript:void(0);">预览</a>
			</div>
			<ul class="editer-menu clearfix">
				<li class="line-md"><img height="36" width="2" src="<%= imagePath %>logic_tab_line.gif" /></li>
            	<li><a class="current"  href="/survey/edit/2c194a71-186f-4af9-8f07-217a0b72ac79"><span>设计问卷</span></a></li>
            	<li class="line-md"><img height="36" width="2" src="<%= imagePath %>logic_tab_line.gif" /></li>
            	<li><a href="/entlogic/edit/2c194a71-186f-4af9-8f07-217a0b72ac79"><span>设计逻辑</span></a></li>
            	<li class="line-md"><img height="36" width="2" src="<%= imagePath %>logic_tab_line.gif" /></li>
            	<li class="relative"><a href="/entquota/edit/2c194a71-186f-4af9-8f07-217a0b72ac79"><span>设定配额</span></a></li>
            	<li class="line-md"><img height="36" width="2" src="<%= imagePath %>logic_tab_line.gif" /></li>
            	<li><a href="/code/show/2c194a71-186f-4af9-8f07-217a0b72ac79"><span>发布问卷</span></a></li>
            	<li class="line-md"><img height="36" width="2" src="<%= imagePath %>logic_tab_line.gif" /></li>
            	<li><a href="/report/simple/2c194a71-186f-4af9-8f07-217a0b72ac79"><span>分析数据</span></a></li>
			</ul>
	    </div>
	    <!-- 标题栏结束  -->
	    
	    <div id="stage" class="afi">
		    <!-- 操作工具栏开始  -->
		    <div class="logic-tab-bg">
				<ul id="tabs" style="width:350px">
					<li id="afi"><a onmousedown="showFields();"><span>新增问题</span></a></li>
					<li id="cfi"><a onmousedown="selectField();"><span>问题编辑</span></a></li>
					<li id="cfo"><a onmousedown="selectForm();"><span>问卷设置</span></a></li>
				</ul>
				<div id="div_export" style="display:none;width:0px;height:0px;">
					<form name="expfrm" id="expfrm" action='/export/survey/word/2c194a71-186f-4af9-8f07-217a0b72ac79' method="post" target="expresult"><input type="hidden" name="filename" value="高血压调研.doc" /></form>
					<iframe name="expresult" style="display:none;"></iframe>
				</div>
				<ul class="fuc-icon-r">
					<li><a title="word导出" href="javascript:void(0);" onclick="surveyExport();return false;"><img height="16" width="16" alt="word导出" src="<%= imagePath %>word_16.png"" /></a></li>
            	</ul>
           		<div class="clear"></div>
			</div>
		    <!-- 操作工具栏结束  -->
		    
		    <!-- 左侧操作栏开始  -->
		    <div id="side">
		    	<!-- 题型开始  -->
		    	<div id="addFields" class="clearfix">
					<div id="shake">
						<h3 class="stand"><font><font>基本题型</font></font></h3>
						<ul id="col1">
							<li id="qtype_single" style="position: relative;" class="dragfld 0"><a id="dx" class="button" href="javascript:void(0);" onclick="addQuestion('single');return false;"><b></b><span> 单选题</span></a></li>
							<li id="qtype_gridsingle" style="position: relative;" class="dragfld 1"><a id="hdx" class="button" href="javascript:void(0);" onclick="addQuestion('gridsingle');return false;"><b></b><span> 每行单选题</span></a></li>
							<li id="qtype_singleopen" style="position: relative;" class="dragfld 2"><a id="dw" class="button" href="javascript:void(0);" onclick="addQuestion('singleopen');return false;"><b></b><span> 单行文本题</span></a></li>
							<li id="qtype_blank" style="position: relative;" class="dragfld 3 wide"><a id="sb" class="button" href="javascript:void(0);" onclick="addQuestion('blank');return false;"><span> 分节符</span></a></li>
						</ul>
						<ul id="col2">
							<li id="qtype_multiple" style="position: relative;" class="dragfld 0"><a id="ddx" class="button" href="javascript:void(0);" onclick="addQuestion('multiple');return false;"><b></b><span> 多选题</span></a></li>
							<li id="qtype_gridmultiple" style="position: relative;" class="dragfld 1"><a id="hddx" class="button" href="javascript:void(0);" onclick="addQuestion('gridmultiple');return false;"><b></b><span> 每行多选题</span></a></li>
							<li id="qtype_paragraph" style="position: relative;" class="dragfld 2"><a id="ddw" class="button" href="javascript:void(0);" onclick="addQuestion('paragraph');return false;"><b></b><span> 多行文本题</span></a></li>
							<li id="qtype_pagebreak" style="position: relative;" class="dragfld 3 wide"><a id="pb" class="button" href="javascript:void(0);" onclick="addQuestion('pagebreak');return false;"><span> 分页符</span></a></li>
						</ul>
						<h3 class="fancy"><font><font>快速题型</font></font></h3>
						<ul id="col3">
							<li id="qtype_name" style="position: relative;" class="dragfld 0"><a id="na" class="button" href="javascript:void(0);" onclick="addQuestion('name');return false;"><b></b><span> 姓名</span></a></li>
							<li id="qtype_age" style="position: relative;" class="dragfld 1"><a id="age" class="button" href="javascript:void(0);" onclick="addQuestion('age');return false;"><b></b><span> 年龄</span></a></li>
							<li id="qtype_address" style="position: relative;" class="dragfld 2"><a id="ad" class="button" href="javascript:void(0);" onclick="addQuestion('address');return false;"><b></b><span> 地址</span></a></li>
							<li id="qtype_phone" style="position: relative;" class="dragfld 3"><a id="ph" class="button" href="javascript:void(0);" onclick="addQuestion('phone');return false;"><b></b><span> 电话</span></a></li>
							<li id="qtype_date" style="position: relative;" class="dragfld 4"><a id="dt" class="button" href="javascript:void(0);" onclick="addQuestion('date');return false;"><b></b><span> 日期</span></a></li>
							<li id="qtype_website" style="position: relative;" class="dragfld 4"><a id="lk" class="button" href="javascript:void(0);" onclick="addQuestion('website');return false;"><b></b><span> 网站链接</span></a></li>
							<li id="qtype_score" style="position: relative;" class="dragfld 4"><a id="sc" class="button" href="javascript:void(0);" onclick="addQuestion('score');return false;"><b></b><span> 评分题</span></a></li>
						</ul>
						<ul id="col4">
							<li id="qtype_sex" style="position: relative;" class="dragfld 0"><a id="sex" class="button" href="javascript:void(0);" onclick="addQuestion('sex');return false;"><b></b><span> 性别</span></a></li>
							<li id="qtype_city" style="position: relative;" class="dragfld 1"><a id="erea" class="button" href="javascript:void(0);" onclick="addQuestion('city');return false;"><b></b><span> 地区</span></a></li>
							<li id="qtype_email" style="position: relative;" class="dragfld 2"><a id="em" class="button" href="javascript:void(0);" onclick="addQuestion('email');return false;"><b></b><span> 电子邮件</span></a></li>
							<li id="qtype_time" style="position: relative;" class="dragfld 3"><a id="tm" class="button" href="javascript:void(0);" onclick="addQuestion('time');return false;"><b></b><span> 时间</span></a></li>
							<li id="qtype_price" style="position: relative;" class="dragfld 4"><a id="pr" class="button" href="javascript:void(0);" onclick="addQuestion('price');return false;"><b></b><span> 价格</span></a></li>
							<li id="qtype_color" style="position: relative;" class="dragfld 5 biggest wide"><a id="cor" class="button" href="javascript:void(0);" onclick="addQuestion('color');return false;"><b></b><span> 选择颜色题</span></a></li>
						</ul>
					</div>
				</div>
				<!-- 题型结束  -->
				
				<!-- 问题编辑开始  -->
				<form id="fieldProperties" class="noI " style="display:none;">
					<ul id="qeditshow"></ul>
					<div style="display: block;" id="listButtons" class="center">
						<a href="javascript:void(0);" onclick="copyQ();return false;" class="positive button" id="listButtonsDuplicate"> 
							<img src="<%= imagePath %>copy.gif" alt="" /> 复制
						</a> 
						<a href="javascript:void(0);" onclick="deleteQ();return false;" class="negative button" id="listButtonsDelete"> 
							<img src="<%= imagePath %>delete1.png" alt="" /> 删除
						</a>
						<a href="javascript:void(0);" onclick="showFields();return false;" class="button" > 
							<img src="<%= imagePath %>textfield_add.png" alt="" /> 新增问题
						</a> 
					</div>
					<div id="qeditshownone" style="display: none;" class="notice t-left">
						<h3><b>未选中问题</b></h3>
						<p>点击右侧区域问题进行编辑</p>
					</div>
				</form>	
				<!-- 问题编辑结束  -->
				
				<!-- 问卷设置开始  -->
					<form id="formProperties" action="#" onsubmit="" class="noI " style="display:none;">
						<ul id="formSettings">
							<li>
								<label class="desc" ><span id="formNameshow">问卷名称</span></label>
								<div>
									<textarea id="formName" rows="2" class="textarea" style=" height:40px" onmouseup="changeSurveyName()" onkeyup="changeSurveyName()"></textarea>
								</div>
							</li>
							<li class="">
								<label class="desc"><span id="formDescriptionshow">问卷描述</span></label>
								<div id="formDescriptionDIV">
									<script type="text/plain" id="formDescription" ></script>
								</div>
							</li>
							<li class="">
                        		<label class="desc"><span id="formWordshow">问卷结束页自定义内容</span></label>
                        		<div>
                            		<textarea id="formWord" onmouseup="changeSurveyWord()" onkeyup="changeSurveyWord()" cols="50" rows="10" class="textarea"></textarea>
                            		<p class="mt4">
                                		<input type="checkbox" value="1" id="formAllowreport" onclick="changeSurveyAllowreport()" /> 
                                		<label id="formAllowreportName" for="formAllowreport">允许被访者答卷完成查看数据统计结果<br />
                                			<span class="smaller gray9">出于安全原因，姓名、地址、电子邮件、电话不会在分享的统计结果中显示 </span>
                                		</label>
                                		<br/>
                            		</p>
                        		</div>
                    		</li>
                    		<li id="showWordurl" style="">
                        		<fieldset class="limitform">
                            		<legend><span id="formWordurl">结束页跳转</span></legend>
                           			<ul>
                                		<li class="ipo-c">
                                    		<p id="UrlCheckDiv" class="mt4">
                                    			<input type="checkbox" value="2" name="formWordtype" id="formWordtype" onclick="changeSurveyWordtype()" />
                                    			<label for="formWordtype">自定义页面</label>
                                    		</p>
                                    		<p id="UrlDiv" class="mt4">
                                        		<input type="text" style=" width:98%" id="formUrl" onmouseup="changeSurveyUrl()" onkeyup="changeSurveyUrl()" value="输入页面URL" class="text" name="" />
                                    		</p>
                                    		<div id="formWordUrlError" class="warning" style="display:none;">您输入的URL似乎不能访问
                                    			<a href="javascript:void(0);" onclick="setWordUrlCheck();return false;" class="ml15">忽略</a>
                                    		</div>
                                			<div id="formWordUrlNull" class="warning" style="display:none;">请输入正确的URL</div>
                                		</li>
                            		</ul>
                        		</fieldset>
                    		</li>
                    		<li>
                        		<fieldset class="limitform">
                            		<legend><span> 设置 </span></legend>
                            		<ul>
                                 		<li>
                                    		<label class="desc"><span> 问卷类别</span></label>
                                    		<div>
	                                        	<select class="select" id="surveyCatalogSelect" autocomplete="off" onclick="changeSurveyType()">
													<option value="100" >客户满意度调查</option>
													<option value="200" >产品满意度调查</option>
													<option value="300" >市场调查</option>
													<option value="400" >员工满意度调查</option>
													<option value="500" >人力资源调查</option>
													<option value="600" >活动策划调查</option>
													<option value="700" >公益组织调查</option>
													<option value="800" >教育培训调查</option>
													<option value="900" >医疗保健调查</option>
													<option value="950" >淘宝卖家调查</option>
													<option value="1000" >其他</option>
												</select>
                                    		</div>
                                		</li>
                                		<li>
                                    		<div>
                                        		<input type="checkbox" id="formProgress" value="1" onclick="changeSurveyProgress()" />
												<label for="formProgress" id="formProgressshow" class="choice">使用进度条</label>
                                    		</div>
                                		</li>
                                		<li>
                                    		<div>
                                        		<input type="checkbox" value="1" id="formIsOpen" onclick="changeSurveyIsOpen()" />
                                        		<label for="formIsOpen"><span> 在问卷中心显示</span></label>
                                    		</div>
                                    		<div id="formIsOpenMsg" class="open-wj-tips" style="display : none;">
                                    			您的问卷将会在<a class="blue" href="/survey-center" target=_blank>公开问卷</a>中显示，以帮助您获得更多的被访者参与答卷
                                    		</div>
                                		</li>
                           			 </ul>
                        		</fieldset>
                    		</li>
							<li>
								<fieldset class="limitform"  style="*z-index:2">
									<legend><span id="formSamplecountshow"> 样本设置</span></legend>
									<ul>
										<li>
								 			<input id="formSamplecountselect" type="checkbox" value="1" onclick="setSurveySamplecount()"/>
								 			<span><label for="formSamplecountselect">设置样本数</label></span>
								 		</li>
										<li>
											&nbsp;&nbsp;&nbsp;&nbsp;<input id="formSamplecount" type="text" class="text" onmouseup="changeSurveySamplecount()" onkeyup="changeSurveySamplecount()"/>
											&nbsp;<span id="formSamplecounttext"></span>
										</li>
										<li>
											<b>样本通知</b>
										</li>
										<li>
											<input id="formEmailnotice" type="checkbox" value="1" onclick="changeSurveyEmailnotice()"/>
											<label for="formEmailnotice">通知到邮件</label>
											<input id="formEmail" type="text" class="text" value=""  onmouseup="changeSurveyEmail()" onkeyup="changeSurveyEmail()" />
										</li>
										<li>
											&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input id="formEmailweek" type="checkbox" value="1" onclick="changeSurveyEmailweek()"/>
											<label for="formEmailweek">每周</label>&nbsp;&nbsp;
											<input id="formEmailmonth" type="checkbox" value="1" onclick="changeSurveyEmailmonth()"/>
											<label for="formEmailmonth">每月</label>&nbsp;&nbsp;
											<input id="formEmailfinish" type="checkbox" value="1" onclick="changeSurveyEmailfinish()"/>
											<label for="formEmailfinish">完成</label>
										</li>
										<li id="mobileli">
											<input id="formMobilenotice" type="checkbox" value="1" onclick="changeSurveyMobilenotice()"/>
											<label for="formMobilenotice">通知到手机</label>
											<input id="formMobile" type="text" class="text" value=""  onmouseup="changeSurveyMobile()" onkeyup="changeSurveyMobile()"/>
											<em class="red smaller" id="formMobileError" style="display:none;"><a href="/version/upgrade" target=_blank>升级开通</a></em>
										</li>
									 	<li>
									 		<label id="formAcceleratesshow"><strong>样本加速回收</strong></label>
										</li>
	                        			<li class="ipo-c">
	                                    	<input id="formAccelerate" type="checkbox" value="1" onclick="changeSurveyAccelerate()" />&nbsp;启用样本加速回收
	                                    </li>
									</ul>
								</fieldset>
							</li>
							<li>
								<fieldset class="limitform" style="*z-index:1">
									<legend><span> 问卷限制</span></legend>
									<ul>
										<li>
											<input id="formAllowcookies" type="checkbox" value="1" onclick="changeSurveycookies()"/>
											<label for="formAllowcookies" id="formAllowcookiesshow">限制<strong>每台电脑</strong>仅能有一个被访者答题</label>
										</li>
										<li>
											<input id="formAllowip" type="checkbox" value="1" onclick="changeSurveyip()"/>
											<label for="formAllowip" id="formAllowipshow">限制<strong>每个IP</strong>仅能有一个被访者答题</label>
										</li>
										<li>
											<input id="formTimeschedule" type="checkbox" value="1" onclick="showTimeschedule()"/>
											<label for="formTimeschedule" id="formTimescheduleshow">问卷限制开始结束时间</label>
										</li>
										<li id="listStartDate">
											<label class="desc">开始日期
												<input id="formStarttime" type="text" class="text" />
											</label>
										</li>
										<li id="listEndDate">
											<label class="desc">结束日期
												<input id="formEndtime" type="text" class="text" />
											</label>
										</li>
									</ul>
								</fieldset>
							</li>
						</ul>
					</form>
				<!-- 问卷设置结束  -->
				
		    </div>
		    <!-- 左侧操作栏结束  -->
		    
		    <!-- 主题正文开始  -->
	    	<div id="themeDiv" style="display: none;float: left;width: 620px;zoom: 1;" class="noI">
	    		<div class="theme-view">
           			<div class="themeslistbox" id="themes1" style="display: block;">
                   		<ul id="themesContainer">
                   		</ul>
                   		<div class="clear"></div>
               		</div>
           		</div>
	    	</div>
		    <!-- 主题正文结束  -->
		    
		    <!-- 问卷正文开始  -->
		    <div id="main" class="noI tooLong">
		    	<form id="formPreview" class="page1 topLabel" action="#">
					<div class="wj-name-logo">
						<div id="survey" class="new-info edit-tit" title="单击编辑。" onclick="showEditSurvey()">
							<img src="<%= imagePath %>arrow2.png" alt="" class="arrow" />
							<h2 id="fname" class="notranslate"></h2>
							<div id="fdescription" class="notranslate"></div>
							<div class="fr" id="fprogressbar" style="display:none;">
								<div class="progress-num">40%</div>
								<div class="progress-bar">
									<div style="width:40%" class="progress-color"></div>
								</div>
							</div>
							<div class="clear"></div>
						</div>
						<div id="showlogo" style="display:" class="edit-logo logo-add"></div>
						<div class="clear"></div>
					</div>
					<ul id="sortable" class="promin">
						<div class="lodding">
							<img src="<%= imagePath %>loading.gif"></img>
						</div>
					</ul>
				</form>
				<div id="formTips" class="edit-tip" >
					<div id="showSaveError" style="display:none;" class="warning"></div>
					<div class="warning" style="display:none;">第2、3页中没有问题，请添加或删除分页符</div>
					<div id="showSaveSuccess" style="display:none;" class="done">保存成功</div>
				</div>
				<div id="formButtons-btn" class="" style="display:none;"></div>
				<div id="formButtons-btn_show" style="display:none;" class="formButtons-btn">
	            	<table width="100%" cellspacing="0">
	                    <tbody>
	                    	 <tr>
	                            <td align="center">
	                            <ul>
	                                <li id="quickqtype_single" class="dragfld 0" style="position: relative; width:90px;"><a onclick="addQuestion('single', true);return false;" href="javascript:void(0);" class="button" id="dx"><b></b><span> 单选题</span></a></li>
	                                <li id="quickqtype_multiple" class="dragfld 0" style="position: relative; width:90px;"><a onclick="addQuestion('multiple', true);return false;" href="javascript:void(0);" class="button" id="ddx"><b></b><span> 多选题</span></a></li>
	                                <li id="quickqtype_gridsingle" class="dragfld 1" style="position: relative; width:112px;"><a onclick="addQuestion('gridsingle', true);return false;" href="javascript:void(0);" class="button" id="hdx"><b></b><span> 每行单选题</span></a></li>
	                                <li id="quickqtype_gridmultiple" class="dragfld 1" style="position: relative; width:112px;"><a onclick="addQuestion('gridmultiple', true);return false;" href="javascript:void(0);" class="button" id="hddx"><b></b><span> 每行多选题</span></a></li>
	                                <li id="quickqtype_singleopen" class="dragfld 2" style="position: relative; width:112px;"><a onclick="addQuestion('singleopen', true);return false;" href="javascript:void(0);" class="button" id="dw"><b></b><span> 单行文本题</span></a></li>
	                                <li class="dragfld 2" style="position: relative; width:100px;"><a href="javascript:void(0);" onclick="shakeFields();return false;" class="button" id="mrt"><b></b><span> 更多题型</span></a></li>
	                            </ul>
	                            </td>
	                        </tr>
	                    </tbody>
	                </table>
	        	</div>
	        	<div id="formButtons" class=""></div>
	        	<div class="formButtons-txt">
	                <table width="100%" cellspacing="0">
	                    <tbody>
	                        <tr>
	                            <td align="center">
	                            <a href="javascript:void(0);" onclick="saveSurvey(this, '1');return false;" id="saveForm" class="button positive" style="padding:10px 15px; font-size:16px;"> <img src="<%= imagePath %>tick.png" alt=""> <span id="saveText">保存问卷</span> </a>
	                            </td>
	                        </tr>
	                    </tbody>
	                </table>
            	</div>
		    </div>
		    <!-- 问卷正文结束  -->
		</div>    
	</div>
	
	<div id="overlay" style="display: none;"></div>
	
	<div class="pop-tipsbox" style="display:none;" id="poptips_show"></div>
	<div class="pop-tips" style="display:none;" id="poptips"></div>
</body>
</html>